

a1 =[8, 1, 2, 3, 4, 5, 77, 99, 33, 10, 11, 22, 33, 44, 55, 66, 7, 2, 3, 4, 7, 8, 0]

a2 = []
a1.each_with_index do |item, index|
  if (a1[index]%2 != 0) then
    a2.push(a1[index])
  end
end

oddSum = a2.inject{|oddSum, x| oddSum + x}

a3 = a1.sort.reverse()

puts(a1.inspect, a2.inspect, a3.inspect, oddSum)